home *** CD-ROM | disk | FTP | other *** search
/ EuroCD 3 / EuroCD 3.iso / Hardware / FGrab / ARexx / Sequence.rexx < prev   
Encoding:
OS/2 REXX Batch file  |  1998-06-24  |  1.3 KB  |  43 lines

  1. /* Framegrabber example script
  2.    Saving of an image sequence */
  3. options results
  4. parse arg name increment               /* Command line: FILE INCREMENT */
  5. if increment <=0 then increment=5
  6. if name=='' then name='T:Test1'
  7. address command
  8. if (show('P','FGRAB'))==0 then do
  9.   'run FrameGrab iconified nomessages' /* start FrameGrab, if it's not */
  10.   do while (show('P','FGRAB'))==0      /* running */
  11.     'wait 1 secs'                      /* for that, it must be in the path */
  12.   end
  13. end
  14. hours=time('H')
  15. minutes=time('M')-60*hours             /* what time is it ? */
  16. minutes=trunc(minutes/increment)*increment
  17. address fgrab
  18. 'SET DISPMESSAGES FALSE'
  19. 'SET FILENUM TRUE'
  20. 'QUERY SAVEAS'
  21. if result='ASK' then 'SET SAVEAS TRUECOLOR'
  22. 'SET FILENAME ' || name                /* set FrameGrabs variables */
  23. address command wait 1 secs
  24. do forever
  25.   minutes=minutes+increment            /* wait until ? */
  26.   if minutes>=60 then do
  27.     minutes=minutes-60
  28.     hours=hours+1
  29.     if hours==24 then hours=0
  30.   end
  31.   say 'Waiting until ' || hours || ':' || minutes
  32.   address command 'wait until ' || hours || ':' || minutes
  33.   'QUERY FROZEN'
  34.   if result='TRUE' then 'FREEZE'       /* activate FrameGrabber */
  35.   address command wait 1 secs
  36.   'CALCPICLEVEL'
  37.   'QUERY SAVEAS'
  38.   if result='SCREEN' then 'RENDER'
  39.   'SAVE'
  40.   'QUERY FILENAME'
  41.   say 'Picture saved as: ' || result
  42. end
  43.